package com.xpxrule.constant;

public enum FieldType {
    STRING("string", "字符串"),
    INTEGER("integer", "整型数"),
    DOUBLE("double", "浮点数"),
    LONG("long", "长整型数"),
    BOOLEAN("boolean", "布尔"),
    DATE("date", "日期"),
    BIG_DECIMAL("bigDecimal", "金额"),
    COLLECTION("collection", "集合");
    private String type;
    private String desc;

    FieldType(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static FieldType getValueTypeByType(String type) {
        for (FieldType fieldType : values()) {
            if (fieldType.type.equals(type)) {
                return fieldType;
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }
}
